<template>
  <div class="input07">
    <label v-if="title!==''">
      <span style="color:red" v-show="req">*</span>
      {{title}}:
    </label>
    <el-input class="input07-input" @change="onchange" @focus="focus" :placeholder="placeholder" v-model="val" :type="type" :disabled="disabled">
        <i slot="suffix" v-bind:class="[icon, 'el-input__icon']"></i>
    </el-input>
  </div>
</template>
<style scoped>
.input07{
    margin: 5px 5px;
}
.input07-input{
  width:auto!important;
}
.input07 i{
    font-size: 18px;
}
.input07 >>> .el-input__inner {
 background: #ffffff;
 /* height: 32px!important; */
 text-align: center;
 width: 100%!important;
}
.input07>>>.el-input__inner{
    height: 32px!important;
 }
.input07>>>.el-input__icon{
    line-height: 32px!important;
 }
</style>
<script>
export default {
  name: "input07",
  props: {
    title:{
      default: ""
    },
    icon:{
       default: ""
    },
    value:{
      default: ""
    },
    type:{
       default: ""
    },
    req:{
       default: false
    },
    placeholder:{
       default:""
    },
    disabled:{
      default:false
    }
   },
  meta:{
    descr:"普通输入框"
  },
  data() {
    return {
      val:''
    };
  },
  methods:{
    onchange(d) {
       this.$emit('input', d);
    },
    focus(){
        this.$emit('focus');
    }
  },
  created(){
    this.val=this.value;
  },
  watch:{
    val(value){
      this.$emit('input', value) ;
    },
    value(){
      this.val = this.value;
    }
  }
};
</script>

